/** 两数组并集；去重
 * 
 * @param arr1 
 * @param arr2 
 * @returns 
 */
export function arrUnion(arr1: any[], arr2: any[]) {
  return [...new Set([...arr1, ...arr2])];
}

/** 两数组交集；去重
 * 
 * @param arr1 
 * @param arr2 
 * @returns 
 */
export function arrCoss(arr1: any[], arr2: any[]) {
  return [...new Set(arr1.filter((item) => arr2.includes(item)))];
}

/** 两数组差集；去重
 * 
 * @param arr1 
 * @param arr2 
 * @returns 
 */
export function arrDiff(arr1: any[], arr2: any[]) {
  return arrUnion(arr1, arr2).filter(
    (item) => !arrCoss(arr1, arr2).includes(item)
  );
}
